import request from '@/utils/request'

// 获取餐厅列表
export function getRestaurantList() {
  return request({
    url: '/api/restaurant/list/all',
    method: 'get'
  })
}


export function getRestaurantPage(params) {
  return request({
    url: '/api/restaurant/page',
    method: 'get',
    params
  })
}

// 获取餐厅详情
export function getRestaurantDetail(id) {
  return request({
    url: `/api/restaurant/${id}`,
    method: 'get'
  })
}

// 新增餐厅
export function saveRestaurant(data) {
  return request({
    url: '/api/restaurant',
    method: 'post',
    data
  })
}

// 更新餐厅
export function updateRestaurant(data) {
  return request({
    url: '/api/restaurant',
    method: 'put',
    data
  })
}

// 删除餐厅
export function deleteRestaurant(id) {
  return request({
    url: `/api/restaurant/${id}`,
    method: 'delete'
  })
}

// 更新餐厅状态
export function updateRestaurantStatus(id, status) {
  return request({
    url: `/api/restaurant/status/${id}/${status}`,
    method: 'put'
  })
}
